<HTML><HEAD><TITLE>var_get_violations(?X, -Violations)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(tentative)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>var_get_violations(?X, -Violations)</H1>
Get X's violation count
<DL>
<DT><EM>X</EM></DT>
<DD>A a tentative variable or instantiated term
</DD>
<DT><EM>Violations</EM></DT>
<DD>Variable, will be bound to a number
</DD>
</DL>
<H2>Description</H2>

	Get X's violations count. The violation count of a tentative variable
	is the cumulative result of all previous increments of that count.
	The violation count of a nonvariable term is 0.
    
<H3>Modes and Determinism</H3><UL>
<LI>var_get_violations(?, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(tentative_value_not_set) </EM>
<DD>X is a variable without tentative value
</DL>
<H2>Examples</H2>
<PRE>
    ?- tent_set(X, 27), var_get_violations(X, V).
    X = X{27 -&gt; 0}
    V = 0
    Yes (0.00s cpu)

    ?- tent_set(X, 27), var_inc_violations(X, 3), var_get_violations(X, V).
    X = X{27 -&gt; 3}
    V = 3
    Yes (0.00s cpu)

    ?- var_get_violations(a, V).
    V = 0
    Yes (0.00s cpu)

    ?- var_get_violations(_, V).
    uncaught exception in exit_block(tentative_value_not_set)
    Abort
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/tentative/tent_set-2.html">tent_set / 2</A>, <A HREF="../../lib/tentative/var_inc_violations-2.html">var_inc_violations / 2</A>
</BODY></HTML>
